<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title><%= title%> </title>
        <style>
            .form-group{
                width: 300px;
                margin:auto
            }
                
            .submitbutton{
                text-align: center;
            }
            form{
                margin: 50px 0 50px 0     
            }
            .reg{
                text-align: left;
                font-size: 2rem;
                border-bottom: 1px solid rgba(0, 0, 0, 0.1);
                margin: 80px 50px 0 50px;
                
            }
            input:focus:invalid{
                box-shadow:0 0 0 3px rgba(248, 5, 5, 0.1);
                border-color:rgba(248, 5, 5, 0.1) ;
            }
            .err{
                width: 300px;
                margin: auto;
                text-align: center;
                margin-top: 30px;
                height: 3rem;
                
                
            }
            .setcolor{
              background-color:  #F89032;
            }

        </style>
         <%-include("link");%> 
    </header> 
    
<body>
    <nav class="navbar navbar-expand-md navbar-dark fixed-top setcolor">
        <div class="navbar-brand" >导航</div>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
  
        <div class="collapse navbar-collapse" id="navbarsExampleDefault">
          <ul class="navbar-nav mr-auto">
            <li class="nav-item ">
              <a class="nav-link" href="/">主页 <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="/login">登陆</a>
            </li>
            <li class="nav-item">
              <a class="nav-link " href="/reg">注册</a>
            </li>
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更多</a>
              <div class="dropdown-menu" aria-labelledby="dropdown01">
                <a class="dropdown-item" href="#">个人主页</a>
                <a class="dropdown-item" href="#">随便逛逛</a>
                <a class="dropdown-item" href="#">登出</a>
              </div>
            </li>
          </ul>
          <form class="form-inline my-2 my-lg-0">
            <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
          </form>
        </div>
      </nav>
      <!---表单--->
      <div class="reg">用户注册</div>
      <!--错误提示-->
      <% if(err!=false){ %>
        <div class=" err alert alert-danger"><%= err%> </div>
      <% } %> 
      <form  method="POST">
        <div class="form-group" >
          <label for="InputName1">用户名</label>
          <input type="text" class="form-control" id="InputName1" name="name" aria-describedby="Help"  autofocus required  maxlength="10" >
          <small id="Help" class="form-text text-muted">用户名只能包括中英文字符和数字,长度在0-10之间</small>
        </div>
        <div class="form-group">
          <label for="InputPassword1">密码</label>
          <input type="password" class="form-control " id="InputPassword1" name="password" required maxlength="10" minlength="5">
        </div>
        <div class="form-group">
            <label for="InputPassword2">确认密码</label>
            <input type="password" class="form-control " id="InputPassword2" name="passwordRepeat" required maxlength="10" minlength="5">
        </div>
        <div class="submitbutton">
        <button type="submit" class="btn btn-primary">注册</button>
        </div>
         
    </form>
   
     
<%-include("scripts"); %>
<script src="javascripts/validate.js"></script>
</body>
</html>